{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "sales = [('account', ['Jones LLc', 'Alpha Co', 'Blue Inc', 'Mega Corp']),\n",
    "         ('Total Sales', [150, 200, 75, 300]),\n",
    "         ('Country', ['US', 'UK', 'US', 'US'])]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df = pd.DataFrame.from_items(sales)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>account</th>\n",
       "      <th>Total Sales</th>\n",
       "      <th>Country</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Jones LLc</td>\n",
       "      <td>150</td>\n",
       "      <td>US</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Alpha Co</td>\n",
       "      <td>200</td>\n",
       "      <td>UK</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Blue Inc</td>\n",
       "      <td>75</td>\n",
       "      <td>US</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mega Corp</td>\n",
       "      <td>300</td>\n",
       "      <td>US</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     account  Total Sales Country\n",
       "0  Jones LLc          150      US\n",
       "1   Alpha Co          200      UK\n",
       "2   Blue Inc           75      US\n",
       "3  Mega Corp          300      US"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "indicates = [True, False, True, True]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>account</th>\n",
       "      <th>Total Sales</th>\n",
       "      <th>Country</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Jones LLc</td>\n",
       "      <td>150</td>\n",
       "      <td>US</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Blue Inc</td>\n",
       "      <td>75</td>\n",
       "      <td>US</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mega Corp</td>\n",
       "      <td>300</td>\n",
       "      <td>US</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     account  Total Sales Country\n",
       "0  Jones LLc          150      US\n",
       "2   Blue Inc           75      US\n",
       "3  Mega Corp          300      US"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[indicates]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1    False\n",
       "2     True\n",
       "3     True\n",
       "Name: Country, dtype: bool"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.Country == 'US'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>account</th>\n",
       "      <th>Total Sales</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mega Corp</td>\n",
       "      <td>300</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     account  Total Sales\n",
       "3  Mega Corp          300"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df[\"Total Sales\"]>200, [\"account\", \"Total Sales\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df[\"rate\"] = 0.02"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>account</th>\n",
       "      <th>Total Sales</th>\n",
       "      <th>Country</th>\n",
       "      <th>rate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Jones LLc</td>\n",
       "      <td>150</td>\n",
       "      <td>US</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Alpha Co</td>\n",
       "      <td>200</td>\n",
       "      <td>UK</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Blue Inc</td>\n",
       "      <td>75</td>\n",
       "      <td>US</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mega Corp</td>\n",
       "      <td>300</td>\n",
       "      <td>US</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     account  Total Sales Country  rate\n",
       "0  Jones LLc          150      US  0.02\n",
       "1   Alpha Co          200      UK  0.02\n",
       "2   Blue Inc           75      US  0.02\n",
       "3  Mega Corp          300      US  0.02"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df.loc[df['Total Sales']>100, ['rate']] = 0.05"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>account</th>\n",
       "      <th>Total Sales</th>\n",
       "      <th>Country</th>\n",
       "      <th>rate</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Jones LLc</td>\n",
       "      <td>150</td>\n",
       "      <td>US</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Alpha Co</td>\n",
       "      <td>200</td>\n",
       "      <td>UK</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Blue Inc</td>\n",
       "      <td>75</td>\n",
       "      <td>US</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Mega Corp</td>\n",
       "      <td>300</td>\n",
       "      <td>US</td>\n",
       "      <td>0.05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     account  Total Sales Country  rate\n",
       "0  Jones LLc          150      US  0.05\n",
       "1   Alpha Co          200      UK  0.05\n",
       "2   Blue Inc           75      US  0.02\n",
       "3  Mega Corp          300      US  0.05"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df = pd.read_excel('https://github.com/chris1610/pbpython/blob/master/data/sample-sales-reps.xlsx?raw=true')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "df['commmision'] =0.02"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "df.loc[df['category']=='Shirt',['commmision']]=0.25"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "df.loc[(df['category']=='Belt')&(df['quantity']>10), ['commmision']]=0.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>account number</th>\n",
       "      <th>customer name</th>\n",
       "      <th>sales rep</th>\n",
       "      <th>sku</th>\n",
       "      <th>category</th>\n",
       "      <th>quantity</th>\n",
       "      <th>unit price</th>\n",
       "      <th>ext price</th>\n",
       "      <th>date</th>\n",
       "      <th>commmision</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>680916</td>\n",
       "      <td>Mueller and Sons</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>19</td>\n",
       "      <td>88.49</td>\n",
       "      <td>1681.31</td>\n",
       "      <td>2015-11-17 05:58:34</td>\n",
       "      <td>0.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>680916</td>\n",
       "      <td>Mueller and Sons</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>FI-01804</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>3</td>\n",
       "      <td>78.07</td>\n",
       "      <td>234.21</td>\n",
       "      <td>2016-02-13 04:04:11</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>530925</td>\n",
       "      <td>Purdy and Sons</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>EO-54210</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>19</td>\n",
       "      <td>30.21</td>\n",
       "      <td>573.99</td>\n",
       "      <td>2015-08-11 12:44:38</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>14406</td>\n",
       "      <td>Harber, Lubowitz and Fahey</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>12</td>\n",
       "      <td>90.29</td>\n",
       "      <td>1083.48</td>\n",
       "      <td>2016-01-23 02:15:50</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>398620</td>\n",
       "      <td>Brekke Ltd</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>5</td>\n",
       "      <td>72.64</td>\n",
       "      <td>363.20</td>\n",
       "      <td>2015-08-10 07:16:03</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>282122</td>\n",
       "      <td>Connelly, Abshire and Von</td>\n",
       "      <td>Beth Skiles</td>\n",
       "      <td>GJ-90272</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>20</td>\n",
       "      <td>96.62</td>\n",
       "      <td>1932.40</td>\n",
       "      <td>2016-03-17 10:19:05</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>398620</td>\n",
       "      <td>Brekke Ltd</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>10</td>\n",
       "      <td>67.64</td>\n",
       "      <td>676.40</td>\n",
       "      <td>2015-11-25 22:05:36</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>218667</td>\n",
       "      <td>Jaskolski-O'Hara</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>11</td>\n",
       "      <td>91.86</td>\n",
       "      <td>1010.46</td>\n",
       "      <td>2016-04-24 15:05:58</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>398620</td>\n",
       "      <td>Brekke Ltd</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>18</td>\n",
       "      <td>98.67</td>\n",
       "      <td>1776.06</td>\n",
       "      <td>2015-08-06 08:09:56</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>14406</td>\n",
       "      <td>Harber, Lubowitz and Fahey</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>12</td>\n",
       "      <td>64.48</td>\n",
       "      <td>773.76</td>\n",
       "      <td>2016-01-08 09:52:04</td>\n",
       "      <td>0.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>887145</td>\n",
       "      <td>Gislason LLC</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>20</td>\n",
       "      <td>92.87</td>\n",
       "      <td>1857.40</td>\n",
       "      <td>2016-05-22 06:09:58</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>93583</td>\n",
       "      <td>Hegmann-Howell</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>17</td>\n",
       "      <td>40.56</td>\n",
       "      <td>689.52</td>\n",
       "      <td>2015-07-05 01:05:52</td>\n",
       "      <td>0.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>280749</td>\n",
       "      <td>Douglas PLC</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>TK-29646</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>17</td>\n",
       "      <td>42.61</td>\n",
       "      <td>724.37</td>\n",
       "      <td>2016-05-16 19:11:55</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>453258</td>\n",
       "      <td>Runolfsson-Bayer</td>\n",
       "      <td>Shannen Hudson</td>\n",
       "      <td>FI-01804</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>20</td>\n",
       "      <td>12.31</td>\n",
       "      <td>246.20</td>\n",
       "      <td>2015-08-24 21:32:26</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>453258</td>\n",
       "      <td>Runolfsson-Bayer</td>\n",
       "      <td>Shannen Hudson</td>\n",
       "      <td>EO-54210</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>20</td>\n",
       "      <td>67.95</td>\n",
       "      <td>1359.00</td>\n",
       "      <td>2015-11-24 15:04:30</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>280749</td>\n",
       "      <td>Douglas PLC</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>GJ-90272</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>17</td>\n",
       "      <td>23.20</td>\n",
       "      <td>394.40</td>\n",
       "      <td>2015-09-12 13:16:56</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>453258</td>\n",
       "      <td>Runolfsson-Bayer</td>\n",
       "      <td>Shannen Hudson</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>2</td>\n",
       "      <td>30.23</td>\n",
       "      <td>60.46</td>\n",
       "      <td>2016-03-21 11:31:24</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>280749</td>\n",
       "      <td>Douglas PLC</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>3</td>\n",
       "      <td>22.64</td>\n",
       "      <td>67.92</td>\n",
       "      <td>2015-12-02 01:55:28</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>398620</td>\n",
       "      <td>Brekke Ltd</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>1</td>\n",
       "      <td>36.20</td>\n",
       "      <td>36.20</td>\n",
       "      <td>2015-12-07 18:45:54</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>251881</td>\n",
       "      <td>Zulauf-Grady</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>9</td>\n",
       "      <td>82.06</td>\n",
       "      <td>738.54</td>\n",
       "      <td>2016-02-23 17:41:41</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>575704</td>\n",
       "      <td>Lindgren, Thompson and Kirlin</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>5</td>\n",
       "      <td>28.51</td>\n",
       "      <td>142.55</td>\n",
       "      <td>2016-03-01 19:34:33</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>887145</td>\n",
       "      <td>Gislason LLC</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>ZY-38455</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>15</td>\n",
       "      <td>95.60</td>\n",
       "      <td>1434.00</td>\n",
       "      <td>2015-10-08 03:01:22</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>575704</td>\n",
       "      <td>Lindgren, Thompson and Kirlin</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>TK-29646</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>11</td>\n",
       "      <td>30.80</td>\n",
       "      <td>338.80</td>\n",
       "      <td>2015-11-25 06:07:47</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>282122</td>\n",
       "      <td>Connelly, Abshire and Von</td>\n",
       "      <td>Beth Skiles</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>6</td>\n",
       "      <td>64.98</td>\n",
       "      <td>389.88</td>\n",
       "      <td>2016-01-15 21:07:30</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>758030</td>\n",
       "      <td>Kilback-Abernathy</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>TK-29646</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>19</td>\n",
       "      <td>26.90</td>\n",
       "      <td>511.10</td>\n",
       "      <td>2015-09-28 14:33:34</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>280749</td>\n",
       "      <td>Douglas PLC</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>15</td>\n",
       "      <td>30.34</td>\n",
       "      <td>455.10</td>\n",
       "      <td>2016-03-29 21:19:08</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>680916</td>\n",
       "      <td>Mueller and Sons</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>2</td>\n",
       "      <td>61.01</td>\n",
       "      <td>122.02</td>\n",
       "      <td>2016-05-19 00:05:12</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>898496</td>\n",
       "      <td>Weissnat, Veum and Barton</td>\n",
       "      <td>Ansley Cummings</td>\n",
       "      <td>TL-23025</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>8</td>\n",
       "      <td>18.34</td>\n",
       "      <td>146.72</td>\n",
       "      <td>2015-07-24 17:48:46</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>530925</td>\n",
       "      <td>Purdy and Sons</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>10</td>\n",
       "      <td>18.40</td>\n",
       "      <td>184.00</td>\n",
       "      <td>2016-03-05 23:45:57</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>752312</td>\n",
       "      <td>Watsica-Pfannerstill</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>15</td>\n",
       "      <td>17.93</td>\n",
       "      <td>268.95</td>\n",
       "      <td>2016-03-18 07:17:35</td>\n",
       "      <td>0.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1470</th>\n",
       "      <td>680916</td>\n",
       "      <td>Mueller and Sons</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>18</td>\n",
       "      <td>17.93</td>\n",
       "      <td>322.74</td>\n",
       "      <td>2016-04-28 01:57:00</td>\n",
       "      <td>0.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1471</th>\n",
       "      <td>218667</td>\n",
       "      <td>Jaskolski-O'Hara</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>TK-29646</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>13</td>\n",
       "      <td>57.80</td>\n",
       "      <td>751.40</td>\n",
       "      <td>2015-11-09 12:17:52</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1472</th>\n",
       "      <td>887145</td>\n",
       "      <td>Gislason LLC</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>5</td>\n",
       "      <td>51.82</td>\n",
       "      <td>259.10</td>\n",
       "      <td>2016-06-08 11:25:05</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1473</th>\n",
       "      <td>93583</td>\n",
       "      <td>Hegmann-Howell</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>ZY-38455</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>10</td>\n",
       "      <td>86.25</td>\n",
       "      <td>862.50</td>\n",
       "      <td>2016-05-10 23:48:57</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1474</th>\n",
       "      <td>530925</td>\n",
       "      <td>Purdy and Sons</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>FI-01804</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>13</td>\n",
       "      <td>10.13</td>\n",
       "      <td>131.69</td>\n",
       "      <td>2016-04-01 20:39:41</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1475</th>\n",
       "      <td>752312</td>\n",
       "      <td>Watsica-Pfannerstill</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>18</td>\n",
       "      <td>23.48</td>\n",
       "      <td>422.64</td>\n",
       "      <td>2015-07-25 05:51:10</td>\n",
       "      <td>0.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1476</th>\n",
       "      <td>758030</td>\n",
       "      <td>Kilback-Abernathy</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>TK-29646</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>7</td>\n",
       "      <td>86.67</td>\n",
       "      <td>606.69</td>\n",
       "      <td>2015-08-19 15:35:31</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1477</th>\n",
       "      <td>398620</td>\n",
       "      <td>Brekke Ltd</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>7</td>\n",
       "      <td>16.52</td>\n",
       "      <td>115.64</td>\n",
       "      <td>2016-04-07 10:25:42</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1478</th>\n",
       "      <td>218667</td>\n",
       "      <td>Jaskolski-O'Hara</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>GJ-90272</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>6</td>\n",
       "      <td>36.44</td>\n",
       "      <td>218.64</td>\n",
       "      <td>2015-11-02 20:55:11</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1479</th>\n",
       "      <td>14406</td>\n",
       "      <td>Harber, Lubowitz and Fahey</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>5</td>\n",
       "      <td>48.52</td>\n",
       "      <td>242.60</td>\n",
       "      <td>2016-05-22 12:34:35</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1480</th>\n",
       "      <td>218667</td>\n",
       "      <td>Jaskolski-O'Hara</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>TL-23025</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>14</td>\n",
       "      <td>88.33</td>\n",
       "      <td>1236.62</td>\n",
       "      <td>2015-07-12 15:59:56</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1481</th>\n",
       "      <td>530925</td>\n",
       "      <td>Purdy and Sons</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>9</td>\n",
       "      <td>62.85</td>\n",
       "      <td>565.65</td>\n",
       "      <td>2015-08-12 17:07:20</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1482</th>\n",
       "      <td>575704</td>\n",
       "      <td>Lindgren, Thompson and Kirlin</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>9</td>\n",
       "      <td>55.57</td>\n",
       "      <td>500.13</td>\n",
       "      <td>2016-02-27 03:20:13</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1483</th>\n",
       "      <td>758030</td>\n",
       "      <td>Kilback-Abernathy</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>GJ-90272</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>8</td>\n",
       "      <td>98.87</td>\n",
       "      <td>790.96</td>\n",
       "      <td>2016-02-10 16:51:59</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1484</th>\n",
       "      <td>136521</td>\n",
       "      <td>Labadie and Sons</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>FI-01804</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>15</td>\n",
       "      <td>99.43</td>\n",
       "      <td>1491.45</td>\n",
       "      <td>2015-12-17 21:58:31</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1485</th>\n",
       "      <td>898496</td>\n",
       "      <td>Weissnat, Veum and Barton</td>\n",
       "      <td>Ansley Cummings</td>\n",
       "      <td>GJ-90272</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>18</td>\n",
       "      <td>11.05</td>\n",
       "      <td>198.90</td>\n",
       "      <td>2016-04-01 10:19:26</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1486</th>\n",
       "      <td>136521</td>\n",
       "      <td>Labadie and Sons</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>20</td>\n",
       "      <td>54.67</td>\n",
       "      <td>1093.40</td>\n",
       "      <td>2016-02-20 10:43:41</td>\n",
       "      <td>0.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1487</th>\n",
       "      <td>218667</td>\n",
       "      <td>Jaskolski-O'Hara</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>TL-23025</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>19</td>\n",
       "      <td>45.97</td>\n",
       "      <td>873.43</td>\n",
       "      <td>2015-08-12 22:53:38</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1488</th>\n",
       "      <td>575704</td>\n",
       "      <td>Lindgren, Thompson and Kirlin</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>TL-23025</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>1</td>\n",
       "      <td>55.81</td>\n",
       "      <td>55.81</td>\n",
       "      <td>2016-02-01 17:50:13</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1489</th>\n",
       "      <td>887145</td>\n",
       "      <td>Gislason LLC</td>\n",
       "      <td>Loring Predovic</td>\n",
       "      <td>ZY-38455</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>10</td>\n",
       "      <td>16.37</td>\n",
       "      <td>163.70</td>\n",
       "      <td>2015-10-11 22:11:45</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1490</th>\n",
       "      <td>898496</td>\n",
       "      <td>Weissnat, Veum and Barton</td>\n",
       "      <td>Ansley Cummings</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>8</td>\n",
       "      <td>83.37</td>\n",
       "      <td>666.96</td>\n",
       "      <td>2016-01-27 03:26:53</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1491</th>\n",
       "      <td>62592</td>\n",
       "      <td>O'Keefe-Koch</td>\n",
       "      <td>Shannen Hudson</td>\n",
       "      <td>TK-29646</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>18</td>\n",
       "      <td>24.92</td>\n",
       "      <td>448.56</td>\n",
       "      <td>2016-02-11 17:13:23</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1492</th>\n",
       "      <td>530925</td>\n",
       "      <td>Purdy and Sons</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>HZ-54995</td>\n",
       "      <td>Belt</td>\n",
       "      <td>3</td>\n",
       "      <td>90.33</td>\n",
       "      <td>270.99</td>\n",
       "      <td>2015-09-23 07:36:34</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1493</th>\n",
       "      <td>93583</td>\n",
       "      <td>Hegmann-Howell</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>5</td>\n",
       "      <td>45.93</td>\n",
       "      <td>229.65</td>\n",
       "      <td>2016-04-13 22:34:56</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1494</th>\n",
       "      <td>14406</td>\n",
       "      <td>Harber, Lubowitz and Fahey</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>ZY-38455</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>16</td>\n",
       "      <td>21.60</td>\n",
       "      <td>345.60</td>\n",
       "      <td>2015-11-18 06:28:56</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1495</th>\n",
       "      <td>136521</td>\n",
       "      <td>Labadie and Sons</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>GP-14407</td>\n",
       "      <td>Belt</td>\n",
       "      <td>4</td>\n",
       "      <td>98.57</td>\n",
       "      <td>394.28</td>\n",
       "      <td>2016-06-01 17:28:44</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1496</th>\n",
       "      <td>575704</td>\n",
       "      <td>Lindgren, Thompson and Kirlin</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>TK-29646</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>3</td>\n",
       "      <td>65.16</td>\n",
       "      <td>195.48</td>\n",
       "      <td>2016-04-02 16:38:31</td>\n",
       "      <td>0.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1497</th>\n",
       "      <td>898496</td>\n",
       "      <td>Weissnat, Veum and Barton</td>\n",
       "      <td>Ansley Cummings</td>\n",
       "      <td>EO-54210</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>17</td>\n",
       "      <td>28.10</td>\n",
       "      <td>477.70</td>\n",
       "      <td>2015-07-20 19:30:10</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1498</th>\n",
       "      <td>62592</td>\n",
       "      <td>O'Keefe-Koch</td>\n",
       "      <td>Shannen Hudson</td>\n",
       "      <td>FI-01804</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>19</td>\n",
       "      <td>94.96</td>\n",
       "      <td>1804.24</td>\n",
       "      <td>2015-10-05 15:55:01</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1499</th>\n",
       "      <td>530925</td>\n",
       "      <td>Purdy and Sons</td>\n",
       "      <td>Teagan O'Keefe</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>3</td>\n",
       "      <td>22.86</td>\n",
       "      <td>68.58</td>\n",
       "      <td>2015-10-07 19:49:38</td>\n",
       "      <td>0.25</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1500 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      account number                  customer name          sales rep  \\\n",
       "0             680916               Mueller and Sons    Loring Predovic   \n",
       "1             680916               Mueller and Sons    Loring Predovic   \n",
       "2             530925                 Purdy and Sons     Teagan O'Keefe   \n",
       "3              14406     Harber, Lubowitz and Fahey  Esequiel Schinner   \n",
       "4             398620                     Brekke Ltd  Esequiel Schinner   \n",
       "5             282122      Connelly, Abshire and Von        Beth Skiles   \n",
       "6             398620                     Brekke Ltd  Esequiel Schinner   \n",
       "7             218667               Jaskolski-O'Hara       Trish Deckow   \n",
       "8             398620                     Brekke Ltd  Esequiel Schinner   \n",
       "9              14406     Harber, Lubowitz and Fahey  Esequiel Schinner   \n",
       "10            887145                   Gislason LLC    Loring Predovic   \n",
       "11             93583                 Hegmann-Howell  Esequiel Schinner   \n",
       "12            280749                    Douglas PLC     Teagan O'Keefe   \n",
       "13            453258               Runolfsson-Bayer     Shannen Hudson   \n",
       "14            453258               Runolfsson-Bayer     Shannen Hudson   \n",
       "15            280749                    Douglas PLC     Teagan O'Keefe   \n",
       "16            453258               Runolfsson-Bayer     Shannen Hudson   \n",
       "17            280749                    Douglas PLC     Teagan O'Keefe   \n",
       "18            398620                     Brekke Ltd  Esequiel Schinner   \n",
       "19            251881                   Zulauf-Grady     Teagan O'Keefe   \n",
       "20            575704  Lindgren, Thompson and Kirlin     Teagan O'Keefe   \n",
       "21            887145                   Gislason LLC    Loring Predovic   \n",
       "22            575704  Lindgren, Thompson and Kirlin     Teagan O'Keefe   \n",
       "23            282122      Connelly, Abshire and Von        Beth Skiles   \n",
       "24            758030              Kilback-Abernathy       Trish Deckow   \n",
       "25            280749                    Douglas PLC     Teagan O'Keefe   \n",
       "26            680916               Mueller and Sons    Loring Predovic   \n",
       "27            898496      Weissnat, Veum and Barton    Ansley Cummings   \n",
       "28            530925                 Purdy and Sons     Teagan O'Keefe   \n",
       "29            752312           Watsica-Pfannerstill    Loring Predovic   \n",
       "...              ...                            ...                ...   \n",
       "1470          680916               Mueller and Sons    Loring Predovic   \n",
       "1471          218667               Jaskolski-O'Hara       Trish Deckow   \n",
       "1472          887145                   Gislason LLC    Loring Predovic   \n",
       "1473           93583                 Hegmann-Howell  Esequiel Schinner   \n",
       "1474          530925                 Purdy and Sons     Teagan O'Keefe   \n",
       "1475          752312           Watsica-Pfannerstill    Loring Predovic   \n",
       "1476          758030              Kilback-Abernathy       Trish Deckow   \n",
       "1477          398620                     Brekke Ltd  Esequiel Schinner   \n",
       "1478          218667               Jaskolski-O'Hara       Trish Deckow   \n",
       "1479           14406     Harber, Lubowitz and Fahey  Esequiel Schinner   \n",
       "1480          218667               Jaskolski-O'Hara       Trish Deckow   \n",
       "1481          530925                 Purdy and Sons     Teagan O'Keefe   \n",
       "1482          575704  Lindgren, Thompson and Kirlin     Teagan O'Keefe   \n",
       "1483          758030              Kilback-Abernathy       Trish Deckow   \n",
       "1484          136521               Labadie and Sons  Esequiel Schinner   \n",
       "1485          898496      Weissnat, Veum and Barton    Ansley Cummings   \n",
       "1486          136521               Labadie and Sons  Esequiel Schinner   \n",
       "1487          218667               Jaskolski-O'Hara       Trish Deckow   \n",
       "1488          575704  Lindgren, Thompson and Kirlin     Teagan O'Keefe   \n",
       "1489          887145                   Gislason LLC    Loring Predovic   \n",
       "1490          898496      Weissnat, Veum and Barton    Ansley Cummings   \n",
       "1491           62592                   O'Keefe-Koch     Shannen Hudson   \n",
       "1492          530925                 Purdy and Sons     Teagan O'Keefe   \n",
       "1493           93583                 Hegmann-Howell  Esequiel Schinner   \n",
       "1494           14406     Harber, Lubowitz and Fahey  Esequiel Schinner   \n",
       "1495          136521               Labadie and Sons  Esequiel Schinner   \n",
       "1496          575704  Lindgren, Thompson and Kirlin     Teagan O'Keefe   \n",
       "1497          898496      Weissnat, Veum and Barton    Ansley Cummings   \n",
       "1498           62592                   O'Keefe-Koch     Shannen Hudson   \n",
       "1499          530925                 Purdy and Sons     Teagan O'Keefe   \n",
       "\n",
       "           sku category  quantity  unit price  ext price                 date  \\\n",
       "0     GP-14407     Belt        19       88.49    1681.31  2015-11-17 05:58:34   \n",
       "1     FI-01804    Shirt         3       78.07     234.21  2016-02-13 04:04:11   \n",
       "2     EO-54210    Shirt        19       30.21     573.99  2015-08-11 12:44:38   \n",
       "3     NZ-99565    Shirt        12       90.29    1083.48  2016-01-23 02:15:50   \n",
       "4     NZ-99565    Shirt         5       72.64     363.20  2015-08-10 07:16:03   \n",
       "5     GJ-90272    Shoes        20       96.62    1932.40  2016-03-17 10:19:05   \n",
       "6     DU-87462    Shirt        10       67.64     676.40  2015-11-25 22:05:36   \n",
       "7     DU-87462    Shirt        11       91.86    1010.46  2016-04-24 15:05:58   \n",
       "8     NZ-99565    Shirt        18       98.67    1776.06  2015-08-06 08:09:56   \n",
       "9     GP-14407     Belt        12       64.48     773.76  2016-01-08 09:52:04   \n",
       "10    NZ-99565    Shirt        20       92.87    1857.40  2016-05-22 06:09:58   \n",
       "11    HZ-54995     Belt        17       40.56     689.52  2015-07-05 01:05:52   \n",
       "12    TK-29646    Shoes        17       42.61     724.37  2016-05-16 19:11:55   \n",
       "13    FI-01804    Shirt        20       12.31     246.20  2015-08-24 21:32:26   \n",
       "14    EO-54210    Shirt        20       67.95    1359.00  2015-11-24 15:04:30   \n",
       "15    GJ-90272    Shoes        17       23.20     394.40  2015-09-12 13:16:56   \n",
       "16    NZ-99565    Shirt         2       30.23      60.46  2016-03-21 11:31:24   \n",
       "17    GP-14407     Belt         3       22.64      67.92  2015-12-02 01:55:28   \n",
       "18    HZ-54995     Belt         1       36.20      36.20  2015-12-07 18:45:54   \n",
       "19    DU-87462    Shirt         9       82.06     738.54  2016-02-23 17:41:41   \n",
       "20    DU-87462    Shirt         5       28.51     142.55  2016-03-01 19:34:33   \n",
       "21    ZY-38455    Shirt        15       95.60    1434.00  2015-10-08 03:01:22   \n",
       "22    TK-29646    Shoes        11       30.80     338.80  2015-11-25 06:07:47   \n",
       "23    HZ-54995     Belt         6       64.98     389.88  2016-01-15 21:07:30   \n",
       "24    TK-29646    Shoes        19       26.90     511.10  2015-09-28 14:33:34   \n",
       "25    NZ-99565    Shirt        15       30.34     455.10  2016-03-29 21:19:08   \n",
       "26    DU-87462    Shirt         2       61.01     122.02  2016-05-19 00:05:12   \n",
       "27    TL-23025    Shoes         8       18.34     146.72  2015-07-24 17:48:46   \n",
       "28    DU-87462    Shirt        10       18.40     184.00  2016-03-05 23:45:57   \n",
       "29    GP-14407     Belt        15       17.93     268.95  2016-03-18 07:17:35   \n",
       "...        ...      ...       ...         ...        ...                  ...   \n",
       "1470  HZ-54995     Belt        18       17.93     322.74  2016-04-28 01:57:00   \n",
       "1471  TK-29646    Shoes        13       57.80     751.40  2015-11-09 12:17:52   \n",
       "1472  GP-14407     Belt         5       51.82     259.10  2016-06-08 11:25:05   \n",
       "1473  ZY-38455    Shirt        10       86.25     862.50  2016-05-10 23:48:57   \n",
       "1474  FI-01804    Shirt        13       10.13     131.69  2016-04-01 20:39:41   \n",
       "1475  HZ-54995     Belt        18       23.48     422.64  2015-07-25 05:51:10   \n",
       "1476  TK-29646    Shoes         7       86.67     606.69  2015-08-19 15:35:31   \n",
       "1477  GP-14407     Belt         7       16.52     115.64  2016-04-07 10:25:42   \n",
       "1478  GJ-90272    Shoes         6       36.44     218.64  2015-11-02 20:55:11   \n",
       "1479  HZ-54995     Belt         5       48.52     242.60  2016-05-22 12:34:35   \n",
       "1480  TL-23025    Shoes        14       88.33    1236.62  2015-07-12 15:59:56   \n",
       "1481  HZ-54995     Belt         9       62.85     565.65  2015-08-12 17:07:20   \n",
       "1482  GP-14407     Belt         9       55.57     500.13  2016-02-27 03:20:13   \n",
       "1483  GJ-90272    Shoes         8       98.87     790.96  2016-02-10 16:51:59   \n",
       "1484  FI-01804    Shirt        15       99.43    1491.45  2015-12-17 21:58:31   \n",
       "1485  GJ-90272    Shoes        18       11.05     198.90  2016-04-01 10:19:26   \n",
       "1486  HZ-54995     Belt        20       54.67    1093.40  2016-02-20 10:43:41   \n",
       "1487  TL-23025    Shoes        19       45.97     873.43  2015-08-12 22:53:38   \n",
       "1488  TL-23025    Shoes         1       55.81      55.81  2016-02-01 17:50:13   \n",
       "1489  ZY-38455    Shirt        10       16.37     163.70  2015-10-11 22:11:45   \n",
       "1490  GP-14407     Belt         8       83.37     666.96  2016-01-27 03:26:53   \n",
       "1491  TK-29646    Shoes        18       24.92     448.56  2016-02-11 17:13:23   \n",
       "1492  HZ-54995     Belt         3       90.33     270.99  2015-09-23 07:36:34   \n",
       "1493  GP-14407     Belt         5       45.93     229.65  2016-04-13 22:34:56   \n",
       "1494  ZY-38455    Shirt        16       21.60     345.60  2015-11-18 06:28:56   \n",
       "1495  GP-14407     Belt         4       98.57     394.28  2016-06-01 17:28:44   \n",
       "1496  TK-29646    Shoes         3       65.16     195.48  2016-04-02 16:38:31   \n",
       "1497  EO-54210    Shirt        17       28.10     477.70  2015-07-20 19:30:10   \n",
       "1498  FI-01804    Shirt        19       94.96    1804.24  2015-10-05 15:55:01   \n",
       "1499  DU-87462    Shirt         3       22.86      68.58  2015-10-07 19:49:38   \n",
       "\n",
       "      commmision  \n",
       "0           0.40  \n",
       "1           0.25  \n",
       "2           0.25  \n",
       "3           0.25  \n",
       "4           0.25  \n",
       "5           0.02  \n",
       "6           0.25  \n",
       "7           0.25  \n",
       "8           0.25  \n",
       "9           0.40  \n",
       "10          0.25  \n",
       "11          0.40  \n",
       "12          0.02  \n",
       "13          0.25  \n",
       "14          0.25  \n",
       "15          0.02  \n",
       "16          0.25  \n",
       "17          0.02  \n",
       "18          0.02  \n",
       "19          0.25  \n",
       "20          0.25  \n",
       "21          0.25  \n",
       "22          0.02  \n",
       "23          0.02  \n",
       "24          0.02  \n",
       "25          0.25  \n",
       "26          0.25  \n",
       "27          0.02  \n",
       "28          0.25  \n",
       "29          0.40  \n",
       "...          ...  \n",
       "1470        0.40  \n",
       "1471        0.02  \n",
       "1472        0.02  \n",
       "1473        0.25  \n",
       "1474        0.25  \n",
       "1475        0.40  \n",
       "1476        0.02  \n",
       "1477        0.02  \n",
       "1478        0.02  \n",
       "1479        0.02  \n",
       "1480        0.02  \n",
       "1481        0.02  \n",
       "1482        0.02  \n",
       "1483        0.02  \n",
       "1484        0.25  \n",
       "1485        0.02  \n",
       "1486        0.40  \n",
       "1487        0.02  \n",
       "1488        0.02  \n",
       "1489        0.25  \n",
       "1490        0.02  \n",
       "1491        0.02  \n",
       "1492        0.02  \n",
       "1493        0.02  \n",
       "1494        0.25  \n",
       "1495        0.02  \n",
       "1496        0.02  \n",
       "1497        0.25  \n",
       "1498        0.25  \n",
       "1499        0.25  \n",
       "\n",
       "[1500 rows x 10 columns]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "df['bonus'] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "df.loc[(df['category']=='Shoes') & (df['ext price']>=1000), ['bonus', 'commmision']] = 250, 0.045"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>account number</th>\n",
       "      <th>customer name</th>\n",
       "      <th>sales rep</th>\n",
       "      <th>sku</th>\n",
       "      <th>category</th>\n",
       "      <th>quantity</th>\n",
       "      <th>unit price</th>\n",
       "      <th>ext price</th>\n",
       "      <th>date</th>\n",
       "      <th>commmision</th>\n",
       "      <th>bonus</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>14406</td>\n",
       "      <td>Harber, Lubowitz and Fahey</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>12</td>\n",
       "      <td>90.29</td>\n",
       "      <td>1083.48</td>\n",
       "      <td>2016-01-23 02:15:50</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>398620</td>\n",
       "      <td>Brekke Ltd</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>NZ-99565</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>5</td>\n",
       "      <td>72.64</td>\n",
       "      <td>363.20</td>\n",
       "      <td>2015-08-10 07:16:03</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>282122</td>\n",
       "      <td>Connelly, Abshire and Von</td>\n",
       "      <td>Beth Skiles</td>\n",
       "      <td>GJ-90272</td>\n",
       "      <td>Shoes</td>\n",
       "      <td>20</td>\n",
       "      <td>96.62</td>\n",
       "      <td>1932.40</td>\n",
       "      <td>2016-03-17 10:19:05</td>\n",
       "      <td>0.045</td>\n",
       "      <td>250</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>398620</td>\n",
       "      <td>Brekke Ltd</td>\n",
       "      <td>Esequiel Schinner</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>10</td>\n",
       "      <td>67.64</td>\n",
       "      <td>676.40</td>\n",
       "      <td>2015-11-25 22:05:36</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>218667</td>\n",
       "      <td>Jaskolski-O'Hara</td>\n",
       "      <td>Trish Deckow</td>\n",
       "      <td>DU-87462</td>\n",
       "      <td>Shirt</td>\n",
       "      <td>11</td>\n",
       "      <td>91.86</td>\n",
       "      <td>1010.46</td>\n",
       "      <td>2016-04-24 15:05:58</td>\n",
       "      <td>0.250</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   account number               customer name          sales rep       sku  \\\n",
       "3           14406  Harber, Lubowitz and Fahey  Esequiel Schinner  NZ-99565   \n",
       "4          398620                  Brekke Ltd  Esequiel Schinner  NZ-99565   \n",
       "5          282122   Connelly, Abshire and Von        Beth Skiles  GJ-90272   \n",
       "6          398620                  Brekke Ltd  Esequiel Schinner  DU-87462   \n",
       "7          218667            Jaskolski-O'Hara       Trish Deckow  DU-87462   \n",
       "\n",
       "  category  quantity  unit price  ext price                 date  commmision  \\\n",
       "3    Shirt        12       90.29    1083.48  2016-01-23 02:15:50       0.250   \n",
       "4    Shirt         5       72.64     363.20  2015-08-10 07:16:03       0.250   \n",
       "5    Shoes        20       96.62    1932.40  2016-03-17 10:19:05       0.045   \n",
       "6    Shirt        10       67.64     676.40  2015-11-25 22:05:36       0.250   \n",
       "7    Shirt        11       91.86    1010.46  2016-04-24 15:05:58       0.250   \n",
       "\n",
       "   bonus  \n",
       "3      0  \n",
       "4      0  \n",
       "5    250  \n",
       "6      0  \n",
       "7      0  "
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.ix[3:7]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "df['comp'] = df['commmision'] * df['ext price'] + df['bonus']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sales rep\n",
       "Ansley Cummings       9006.11070\n",
       "Beth Skiles           8421.72815\n",
       "Esequiel Schinner    37817.60455\n",
       "Loring Predovic      42603.82200\n",
       "Shannen Hudson       21041.04650\n",
       "Teagan O'Keefe       40658.46705\n",
       "Trish Deckow         25275.26040\n",
       "Name: comp, dtype: float64"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby(['sales rep'])['comp'].sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
